package edu.jmu.jdbc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

public class CreateTable {

	public static void main(String[] args) {
		String xmlPath = "JdbcTemplateBeans.xml";
		ApplicationContext context = new ClassPathXmlApplicationContext(xmlPath);
		JdbcTemplate jdbcTemplate = (JdbcTemplate)context.getBean("jdbcTemplate");
		String sql = "create table t_user(userid int primary key auto_increment,"+
					"username varchar(50),password varchar(32))";
		jdbcTemplate.execute(sql);
		System.out.println("Table t_user Created");

	}

}
